// 数组去空转class名称
export const toClassName = (arr: any[]) => {
  return arr
    .filter((item) => {
      return Object.prototype.toString.call(item) === "[object String]";
    })
    .join(" ");
};


/**
 * @description 枚举转数组
 * @returns {Array<{text:string,value:string}>}
 */
export const enumConvertOption = (obj: { [s: string]: any }) => {
  return Object.entries(obj).map(([value, text]: any) => ({
    // eslint-disable-next-line no-restricted-globals
    value: isNaN(value) ? value : Number(value),
    text,
  }));
};


/**
 * 
 * @param url 图片地址
 * @returns  图片链接
 */
export const getImgUrl = (url: string) => {
  return `http://8.137.109.35:9001/hs-bucket/${url}`;
};
